package cn.edu.ctbu.kcsj.service;

import cn.edu.ctbu.kcsj.domain.Teacher;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface TeacherService {
    List<Teacher> findAll();

    /**
     * 只分页的查询
     * @param pageable
     * @return
     */
    Page<Teacher> findAll(Pageable pageable);

    /**
     * 分页，带过滤的查询
     * @param teacher
     * @param pageable
     * @return
     */
    Page<Teacher>findAll(Example<Teacher> teacher, Pageable pageable);
    /**
     * 验证用户名和密码，通过返回读取老师
     * @param Tno
     * @param password
     */
    Teacher validateTnoAndTpassword(Integer Tno, String password) throws Exception;

    List<Teacher> findByTnoAndTpassword(Integer Tno, String password);

    Teacher getByTno(Integer tno);

    Teacher insert(Teacher teacher);

    Teacher update(Teacher teacher);

    void delete(Integer tno);
}
